<include file="Public/head"/>
<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <include file="Public/sidebar"/>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>

                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <form class="form-horizontal"  method="post">
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 属性名称 </label>
                                <div class="col-sm-9">
                                    <input type="text" name="name" id="name" class="rcol-xs-10 col-sm-5"
                                           value="{$currentmenu.name}">
                                    <span class="help-inline col-xs-12 col-sm-7">
                                                                                                <span class="middle"></span>
                                                                                        </span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-10">
                                    商品类别 </label>
                                <input name="id" value="{$currentmenu.id}" type="hidden">
                                <div class="col-sm-9">
                                    <select id="category_id" name="category_id" class="rcol-xs-10 col-sm-5">
                                        <volist name="option" id="v">
                                            <option value="{$v.id}"
                                            <if condition="$currentmenu.category_id eq $v['id']">selected="selected"</if>
                                            >{$v['name']}</option>
                                       
                                               <notempty name="v.children">
                                                    <foreach name="v.children" item="vv" key="kk" >
                                                      <option value="{$vv.id}"
                                                      <if condition="$currentmenu.category_id eq $vv['id']">selected="selected"</if>
                                                      >&nbsp;&nbsp;┗━{$vv['name']}</option>
                                                          <notempty name="vv.children">
                                                            <foreach name="vv.children" item="vvv" key="kkk" >
                                                              <option value="{$vvv.id}"
                                                              <if condition="$currentmenu.category_id eq $vvv['id']">selected="selected"</if>
                                                              >&nbsp;&nbsp;&nbsp;&nbsp;┗━{$vvv['name']}</option>
                                                                      <notempty name="vvv.children">
                                                                            <foreach name="vvv.children" item="vvvv" key="kkkk" >

                                                                                   <option value="{$vvvv.id}"
                                                                                   <if condition="$currentmenu.category_id eq $vvvv['id']">selected="selected"</if>
                                                                                   >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;┗━{$vvvv['name']}</option>
                                                                                       <notempty name="vvvv.children">
                                                                                           <foreach name="vvvv.children" item="vvvvv" key="kkkkk" >
                                                                                            <option value="{$vvvvv.id}"
                                                                                            <if condition="$currentmenu.category_id eq $vvvvv['id']">selected="selected"</if>
                                                                                            >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;┗━{$vvvvv['name']}</option>
                                                                                             </foreach>
                                                                                       </notempty>
                                                                            </foreach>
                                                                        </notempty>
                                                             </foreach>
                                                         </notempty>
                                                      </foreach>
                                                 </notempty>
                                            </volist>
                                    </select>
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle"></span>
											</span>
                                </div>
                            </div>
                           

                        

                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-10">
                                    属性类别 </label>
                                <div class="col-sm-9">
                                    <select id="type" name="type" onchange="bute(this)" class="rcol-xs-10 col-sm-5">
                                        <option value="1"  <if condition="$currentmenu.type eq 1">selected="selected"</if>
                                                      >文本</option>
                                        <option value="2"  <if condition="$currentmenu.type eq 2">selected="selected"</if>>单选</option>
                                        <option value="3"  <if condition="$currentmenu.type eq 3">selected="selected"</if>>多选</option>
                                        <option value="4"  <if condition="$currentmenu.type eq 4">selected="selected"</if>>下拉</option>
                                    </select>
                                </div>  
                            </div>  
                            <div class="space-4"></div>
                            <div class="form-group" id="bute_val" <?php if(empty($currentmenu['type'])|| $currentmenu['type'] == 1):?>style="display:none;"<?php endif;?>>
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-10">
                                    属性值 </label>  
                                <div class="col-sm-9">
                                    <textarea class="rcol-xs-10 col-sm-5" name="bute_val" >{$currentmenu['bute_val']}</textarea>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-10">
                                    默认值 </label>  
                                <div class="col-sm-9">
                                     <input type="text" name="default" id="default" class="rcol-xs-10 col-sm-5"
                                           value="{$currentmenu.default}">
                                </div>
                            </div>
                             <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-10">
                                    排序 </label>  
                                <div class="col-sm-9">
                                     <input type="text" name="sort" id="sort" class="rcol-xs-10 col-sm-5"
                                           value="{$currentmenu.sort}">
                                </div>
                            </div>
                             <div class="space-4"></div> 
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2"> 是否检索 </label>
                                <div class="control-label no-padding-left col-sm-1">
                                    <label>
                                        <input name="status" id="status" value="1" checked="" class="ace ace-switch ace-switch-2" type="checkbox">
                                        <span class="lbl"></span>
                                    </label>
                                </div>
                                <span class="help-inline col-xs-12 col-sm-7">
										<span class="middle"></span>
								</span>
                            </div> 
                           
                            <div class="col-md-offset-2 col-md-9">
                                <button class="btn btn-info" type="submit">
                                    <i class="icon-ok bigger-110"></i>
                                    提交
                                </button>

                                &nbsp; &nbsp; &nbsp;
                                <button class="btn" type="reset">
                                    <i class="icon-undo bigger-110"></i>
                                    重置
                                </button>
                            </div>
                        </form>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public/footer"/>

</div><!-- /.main-container -->

<include file="Public/footerjs"/>
<!-- inline scripts related to this page -->
<script type="text/javascript">
    function bute(obj){
       var id = parseInt($(obj).find('option:selected').val());
       if(id == 2 || id ==3 || id == 4){
           $("#bute_val").show();
       }else{
             $("#bute_val").hide();
       }
    }
    $(function () {
        var editor = KindEditor.create('textarea[name="demo"]', {
            resizeType: 1,
            allowPreviewEmoticons: false,
            allowImageUpload: false,
            items: [
                'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
                'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
                'insertunorderedlist', '|', 'emoticons', 'link']
        });
        $(".btn.btn-info").click(function () {
            var name = $("#name").val();
            if (name == '') {
                bootbox.alert({
                    buttons: {
                        ok: {
                            label: '确定',
                            className: 'btn-myStyle'
                        }
                    },
                    message: '分类名称不能为空。',
                    title: "友情提示",
                });
                return false;
            }

        })
    })
</script>

</body>
</html>
